package com.xyh.system.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author kyle
 * @since 2021-01-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Menu extends Model {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单 ID
     */
    @TableId(value = "menu_id", type = IdType.AUTO)
    private Integer menuId;

    private Integer parentId;

    /**
     * 菜单名称
     */
    private String menuName;

    /**
     * 菜单 URL
     */
    private String url;

    /**
     * 权限标识符
     */
    private String perms;

    /**
     * 排序
     */
    private Integer orderNum;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    private LocalDateTime modifyTime;

    /**
     * 图标
     */
    private String icon;

    /**
     * 树状菜单复选框需要的属性
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @TableField(exist = false)
    private String checkArr = "0";

    /**
     * Menu子集菜单权限
     */
    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Menu> children;
}
